<%@ page language="java" import="java.util.*,com.hs.auth.model.*,com.hs.auth.*" pageEncoding="utf-8"%>
<%
HsAccount accInfo = (HsAccount)session.getAttribute(AUTHConstant.USERINSESSION); 
String accid = String.valueOf(accInfo==null?"":accInfo.getId());
Map authMap = (Map)session.getAttribute("USERPOWER_"+accInfo.getId()); 
 if(authMap == null)
	authMap = new HashMap();
String authstr = null;
String systemstr = null; 
 //String username = (String)request.getAttribute("username"); 
  System.out.println(authMap);
 
boolean isadmin = "system".equals(accInfo==null?"":accInfo.getLoginid());
boolean role1 = (authMap.get("CHD_ROLE1")!=null);//系统管理员
boolean role2 = (authMap.get("CHD_ROLE2")!=null); //全文检索人员
boolean role3 = (authMap.get("CHD_ROLE3")!=null); //数据管理员
boolean role4 = (authMap.get("CHD_ROLE4")!=null); //题录检索人员
 
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html >
<head>
<%@ include file="../include.jsp"%>   
<script language=JavaScript> 
var myDate = new Date();
   // myDate.getYear();       //获取当前年份(2位)
  //  myDate.getFullYear();   //获取完整的年份(4位,1970-????)
  //  myDate.getMonth();      //获取当前月份(0-11,0代表1月)
  //  myDate.getDate();       //获取当前日(1-31)
  //  myDate.getDay();        //获取当前星期X(0-6,0代表星期天)
 //   myDate.getTime();       //获取当前时间(从1970.1.1开始的毫秒数)
 //   myDate.getHours();      //获取当前小时数(0-23)
 //   myDate.getMinutes();    //获取当前分钟数(0-59)
 //   myDate.getSeconds();    //获取当前秒数(0-59)
 //   myDate.getMilliseconds();   //获取当前毫秒数(0-999)
 //   myDate.toLocaleDateString();    //获取当前日期
 //   var mytime=myDate.toLocaleTimeString();    //获取当前时间
 //   myDate.toLocaleString( );       //获取日期与时间 
 
// 显示服务器的当前时间
 var OA_TIME = new Date( myDate.getFullYear(),myDate.getMonth(),myDate.getDate(),myDate.getHours(),myDate.getMinutes(),myDate.getSeconds());
//var OA_TIME = new Date( myDate.getFullYear(),myDate.getMonth(),myDate.getDate());

function timeview()

{
  timestr=OA_TIME.toLocaleString(); 
  //timestr=timestr.substr(timestr.indexOf(":")-2);
  document.getElementById("Head1Right_Time").innerHTML = timestr;
  OA_TIME.setSeconds(OA_TIME.getSeconds()+1);
  window.setTimeout( "timeview()", 1000 );
   
}

function modifyUserinfo(){
   var pageURL = "<%=basePath %>auth/modifyUserinfo.do?uid=<%=accid %>";
   openwindow(pageURL,'800','600','修改个人信息'); 
}
function searchIndex(){
	window.parent.cont.frameElement.src="<%=basePath%>search/index.do"; 
}
function dictIndex(){
   
	window.parent.cont.frameElement.src="<%=basePath%>common/dict/dictFrame.jsp";
	 
}
function userIndex(){
     
	window.parent.cont.frameElement.src="<%=basePath%>/auth/userFrame.do";
	 
}
function magaIndex(){
	window.parent.cont.frameElement.src="<%=basePath%>data/magalistframe.do"; 
}
function bookIndex(){
	window.parent.cont.frameElement.src="<%=basePath%>data/booklistframe.do"; 
}
function impIndex(){
	window.parent.cont.frameElement.src="<%=basePath%>data/dataimport.do"; 
}
function standIndex(){
	window.parent.cont.frameElement.src="<%=basePath%>standard/standdataframe.do"; 
}
function tagsIndex(){
	window.parent.cont.frameElement.src="<%=basePath%>standard/tagsframe.do"; 
}
</script>
</head>
<body>
    <div class="nav">
	<div class="date"><p><em><span id="Head1Right_Time"></span></em></p> </div>
    <a href="javaScript:searchIndex();" class="curr"><span>文献检索</span></a>
    <%if(isadmin||role1||role3){%>
    <a href="javaScript:magaIndex();"><span>期刊管理</span></a>
    <a href="javaScript:bookIndex();"><span>古籍管理</span></a>
    <a href="javaScript:impIndex();"><span>数据导入</span></a>
    <a href="javaScript:standIndex();"><span>标准数据</span></a>
    <a href="javaScript:tagsIndex();"><span>主题分类</span></a>
    <%} %>
    <%if(role1||isadmin){%>
    	<a href="javaScript:userIndex();"><span>用户管理</span></a>
    	<a href="javaScript:dictIndex();"><span>系统管理</span></a>
    <%} %>     
</div>
</body>
</html> 
<script>
timeview();
</script>